
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
zip-zip-top
Advanced tools
Easily zip files & folders. Relies on jszip (https://stuk.github.io/jzip).
ZipZipTop is a nodejs modules which relies on jszip. It allows to simply add files & recursive folder in a zip.
$ npm install zip-zip-top
var fs = require("fs");
var ZipZipTop = require("zip-zip-top");
var zip = new ZipZipTop();
//add text
zip.file("hello.txt", "Hello World!");
//write zip data to disk
zip.writeToFile("text.zip", (err) => {
if(err) {
console.error(err);
}
});
//add folder
var zip2 = new ZipZipTop();
var jsFolder = zip2.folder("js");
jsFolder.file("hello.js", console.log("hello world"));
//get a stream to handle events your way
zip2.getStream().pipe(fs.createWriteStream("folder.zip"))
.on("end", () => {
console.log("done");
};
//add file
var zip3 = new ZipZipTop();
zip3.addFile("main.js", (err) => {
if(err) {
console.log(err);
}
zip3.writeToFile("file.zip", (writeErr) => {
if(writeErr) {
console.error(writeErr);
}
});
});
//zip a folder
var zip4 = new ZipZipTop();
zip4.zipFolder("../myfolder", (err) => {
if(err) {
console.log(err);
}
zip4.writeToFile("folder.zip", (err) => {
if(err) {
return console.log(err);
}
console.log("Done");
});
});
//zip a folder and change folder destination name
var zip6 = new ZipZipTop();
zip6.zipFolder("../myfolder", () =>{
if(err) {
console.log(err);
}
zip6.writeToFile("myfolder.zip", (err) => {
if(err) {
return console.log(err);
}
console.log("Done");
});
}, {rootFolder: "newRootFolder"});
//write to file sync
//zip.writeToFileSync(filePath);
This is a very simple project made for my personal needs. If you feel like coding some missing features, I would be glad to work with you. Suggestions and/or pull requests are welcome!
MIT
FAQs
Easily zip files & folders. Relies on jszip (https://stuk.github.io/jzip).
The npm package zip-zip-top receives a total of 77 weekly downloads. As such, zip-zip-top popularity was classified as not popular.
We found that zip-zip-top demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.